package com.exm.sql.controller;

import com.exm.sql.model.User;
import com.exm.sql.model.vo.ResponseResult;
import com.exm.sql.service.UserSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserSerivce userSerivce;


    @RequestMapping("/info")
    public ResponseResult info() {
        return userSerivce.getUserInfo();
    }

    @RequestMapping("/save")
    public ResponseResult save(@RequestBody User user) {
        return userSerivce.save(user);
    }



}
